import request from '@/config/axios'

// 科室内容 API
export const ContentDeptApi = {
  // 查询科室内容分页
  getContentDeptPage: async (params: any) => {
    return await request.get({ url: `/cms/content-dept/page`, params })
  },
  getContentDeptList: async () => {
    return await request.get({ url: `/cms/content-dept/list` })
  },
  getContentDept: async (id: number) => {
    return await request.get({ url: `/cms/content-dept/get?id=${id}` })
  },

  getByMenuId: async (menuId: number) => {
    return await request.get({ url: `/cms/content-dept/getByMenuId?menuId=${menuId}` })
  },

  // 新增科室内容
  createContentDept: async (data: any) => {
    return await request.post({ url: `/cms/content-dept/create`, data })
  },

  // 修改科室内容
  updateContentDept: async (data: any) => {
    return await request.put({ url: `/cms/content-dept/update`, data })
  },

  // 删除科室内容
  deleteContentDept: async (id: number) => {
    return await request.delete({ url: `/cms/content-dept/delete?id=` + id })
  },

  // 导出科室内容 Excel
  exportContentDept: async (params) => {
    return await request.download({ url: `/cms/content-dept/export-excel`, params })
  }
}
